package com.zhxq.ai.domain.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.ai.chat.messages.Message;

import java.time.LocalDateTime;
import java.time.LocalTime;
import java.util.Date;

@Data
@NoArgsConstructor
public class MessageVo {

    private String role;

    private String content;

    @JsonFormat(pattern = "HH:mm:ss")
    private Date chatTime;

    public MessageVo(Message message) {
        this.role = message.getMessageType().getValue();
        this.content = message.getText();
    }
}
